package wyp.library.ui.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class WypLogFragment extends Fragment {

	protected boolean isShowLog() {
		return false;
	}

	public String _getTag() {
		return getClass().getSimpleName();
	}

	@Override
	public void onAttach(Activity activity) {
		if (isShowLog()) {
			Log.e(_getTag(), "--onAttach");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onAttach(activity);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		if (isShowLog()) {
			Log.e(_getTag(), "--onCreate");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		if (isShowLog()) {
			Log.e(_getTag(), "--onCreateView");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		return super.onCreateView(inflater, container, savedInstanceState);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		if (isShowLog()) {
			Log.e(_getTag(), "--onActivityCreated");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onActivityCreated(savedInstanceState);
	}

	@Override
	public void onStart() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onStart");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onStart();
	}

	@Override
	public void onResume() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onResume");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onResume();
	}

	@Override
	public void onPause() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onPause");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onPause();
	}

	@Override
	public void onStop() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onStop");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onStop();
	}

	@Override
	public void onDestroyView() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onDestroyView");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onDestroyView();
	}

	@Override
	public void onDestroy() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onDestroy");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onDestroy();
	}

	@Override
	public void onDetach() {
		if (isShowLog()) {
			Log.e(_getTag(), "--onDetach");
			Log.e(_getTag(), "--getActivity：" + getActivity() == null ? "null" : getActivity().toString());
		}
		super.onDetach();
	}
}
